home *** CD-ROM | disk | FTP | other *** search
/ Champak 33 / Volume 33 - JOGO DISK .iso / Games / protect_the_fire.swf / scripts / DefineSprite_274 / frame_18 / DoAction.as
Encoding:
Text File  |  2007-01-15  |  944 b   |  50 lines

  1. trace("AI: loop");
  2. angle = "0";
  3. rot = getProperty("../computer", _rotation);
  4. anchorx = getProperty("../computer", _X);
  5. anchory = getProperty("../computer", _Y);
  6. trace("AI: tar: " add tar);
  7. tar = "1";
  8. while(true)
  9. {
  10.    ┬º┬ºpush(tar < eval("../:rafts") + "1");
  11.    if(tar < eval("../:rafts") + "1")
  12.    {
  13.       ┬º┬ºpop();
  14.       ┬º┬ºpush(eval("../raft" add tar add "/:destroyed") == "1");
  15.       if(eval("../raft" add tar add "/:destroyed") != "1")
  16.       {
  17.          ┬º┬ºpop();
  18.          ┬º┬ºpush(eval("../raft" add tar add "/:team") != "1");
  19.       }
  20.    }
  21.    if(!┬º┬ºpop())
  22.    {
  23.       break;
  24.    }
  25.    tar += "1";
  26. }
  27. call("mSetTarget");
  28. call("mSetAngle");
  29. if(deltay < "0")
  30. {
  31.    angle *= "-1";
  32. }
  33. deltar = angle - deltar;
  34. if(deltar < "0")
  35. {
  36.    down = "1";
  37.    tellTarget("../char2/body")
  38.    {
  39.       gotoAndPlay(2);
  40.    }
  41. }
  42. else
  43. {
  44.    down = "0";
  45.    tellTarget("../char2/body")
  46.    {
  47.       gotoAndPlay(14);
  48.    }
  49. }
  50.